package demo2;

interface IShape{
    void draw();

}
class Rectangle implements IShape{
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}
class Circle implements IShape{
    @Override
    public void draw() {
        System.out.println("圆");
    }
}
class Triangle implements  IShape{

    @Override
    public void draw() {
        System.out.println("三角形");
    }
}

public class Test {
    public static void drawFuc(IShape shape){
        shape.draw();
    }

    public static void main(String[] args) {
        drawFuc(new Rectangle());
        drawFuc(new Circle());
        drawFuc(new Triangle());

    }
}
